<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/public/inc/tags.jsp"%>
<input type="hidden" value="${model.bannerid}" name="bannerid">
<%--<input type="hidden" value="${model.bannertype}" name="bannertype">--%>
<div class="form-horizontal">
    <div class="form-group">
        <label class="control-label col-md-2">产品编号</label>
        <div class="col-md-10">
            <input type="text" id="id" name="id" class="form-control" placeholder="请输入主题编号"
                   value="${model.id}"/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-md-2">产品名称</label>
        <div class="col-md-10">
            <input type="text" id="theme" name="theme" class="form-control" placeholder="请输入主题名称"
                   value="${model.theme}"/>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-md-2">封面</label>
        <div class="col-md-10">
            <input type="hidden" name="img" value="${model.img}"/>
            <input type="file" class="btn btn-primary" id="img" name="ImgFile"/>
            <img src="http://img.readerday.com/cover/${model.img}" class="thumbnail"
                 style="height: 200px;<c:if test="${model.img==null}">display: none;</c:if>">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-md-2">类型</label>
        <div class="col-md-10">
            <select id="bannertype" name="bannertype" class="form-control">
                <option value="">请选择</option>
                <option value="6" <c:if test="${model.bannertype==6}"> selected="selected"</c:if>>阅读包</option>
                <option value="7" <c:if test="${model.bannertype==7}"> selected="selected"</c:if>>会员</option>
                <option value="8" <c:if test="${model.bannertype==8}"> selected="selected"</c:if>>小课</option>
                <option value="9" <c:if test="${model.bannertype==9}"> selected="selected"</c:if>>单本解读</option>
                <option value="11" <c:if test="${model.bannertype==11}"> selected="selected"</c:if>>赠一得一</option>
                <option value="12" <c:if test="${model.bannertype==12}"> selected="selected"</c:if>>书单列表</option>
                <option value="13" <c:if test="${model.bannertype==13}"> selected="selected"</c:if>>广告</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-md-2">是否启用</label>
        <div class="col-md-10">
            <select id="status" name="status" class="form-control">
                <option value="">请选择</option>
                <option value="1" <c:if test="${model.status==1}"> selected="selected"</c:if>>否</option>
                <option value="0" <c:if test="${model.status==0}"> selected="selected"</c:if>>是</option>
            </select>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-md-2">排序</label>
        <div class="col-md-10">
            <input type="text" id="sort" name="sort" class="form-control" placeholder="请输入排序"
                   value="${model.sort}"/>
        </div>
    </div>
    <div class="form-group">
        <div class="col-md-offset-2 col-md-10">
            <button type="submit" class="btn btn-primary">
                <i class="fa fa-floppy-o"></i> 保存
            </button>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(document).ready(function () {

        $("#form1").bootstrapValidator({
            feedbackIcons: {
                valid: 'glyphicon glyphicon-ok',
                invalid: 'glyphicon glyphicon-remove',
                validating: 'glyphicon glyphicon-refresh'
            },
            fields: {
                status: {
                    validators: {
                        regexp: {
                            regexp: /^[0-1]*$/,
                            message: '必须选择启用或禁用中的一个'
                        }
                    }
                }
            }
        });
    });
</script>